<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Monkey PHP Framework</title>
<link type="text/css" href="statics/css/base.css" rel="stylesheet" />
<script type="text/javascript" src="statics/js/jquery.min.js"></script>
<script type="text/javascript" src="statics/js/monkey.js"></script>
<link type="text/css" href="statics/css/prettify.css" rel="stylesheet" />
<script type="text/javascript" src="statics/js/prettify.js"></script>
<script type="text/javascript" src="statics/js/html5.js"></script>

</head>

<body>
<!--page_wrap:start-->
<div class="page_wrap">
<p>
<h2>2.8 缓存的配置</h2>
<b>配置位置：oApp()->cacheSet;</b><br />
<b>默认配置内容：</b><br />
<pre class="prettyprint linenums">
&lt?php
    //缓存配置
    public $cacheSet=array(
        'type'=>'File',//选择缓存：默认为File（无需安装），推荐Apc（需要安装），Memcache等更多缓存请见缓存类库目录
        'expire'        =>3600,//默认缓存时间
        /* file专有设置（不用时请注释掉）*/
        'dir'           =>'',//缓存文件的绝对路径，留空为 TEMP.'/filecache'
        'filename'      =>'data',
        'filesize'      =>'15M',
        'check'         =>false,
        /* memcache专有设置（不用时请注释掉）
        'host'          =>'localhost',
        'port'          =>11211,
        'persistent'    =>'',
        'compressed'    =>FALSE,
        */
    );
?&gt
</pre>
</p>
<p>
<h2>2.8 缓存的使用，通过一个管理类\Monkey\CacheManager来调用</h2>
<br/>
<b>公开方法：</b><br/>
<table class="table table_bordered table_striped">
    <thead>
        <tr>
            <th>方法名（斜体为链式操作）</th>
            <th>参数</th>
            <th>说明</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <th>getCacheByType</th>
            <td>string|null $type 缓存类型，为空时由配置指定</td>
            <td>通过类型获取缓存。返回\Monkey\Cache\_Interface型的对象</td>
        </tr>
        <tr>
            <th>getFileCache</th>
            <td>string|null $filename 文件名，默认为 'data'<br/>
            string|null $dir 文件目录，默认为 TEMP.'/filecache'<br/>
            string|null $filesize 文件大小，默认为 '15M'
            </td>
            <td>获取File型缓存。返回\Monkey\Cache\_Interface型的对象</td>
        </tr>
        <tr>
            <th>getApcCache</th>
            <td>无</td>
            <td>获取Apc型缓存。返回\Monkey\Cache\_Interface型的对象</td>
        </tr>
        <tr>
            <th>getEacceleratorCache</th>
            <td>无</td>
            <td>获取Eaccelerator型缓存。返回\Monkey\Cache\_Interface型的对象</td>
        </tr>
        <tr>
            <th>getMemcacheCache</th>
            <td>无</td>
            <td>获取Memcache型缓存。返回\Monkey\Cache\_Interface型的对象</td>
        </tr>
        <tr>
            <th>getXcache</th>
            <td>无</td>
            <td>获取Xcache型缓存。返回\Monkey\Cache\_Interface型的对象</td>
        </tr>
    </tbody>
</table>

</p>


</div>
<!--page_wrap:end-->
</body>
</html>